﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace UnitTest.Common.Exception;

public class GlobalExceptionFilter : IExceptionFilter
{
    public void OnException(ExceptionContext context)
    {
        var exception = context.Exception;
       if (exception is BusinessException businessException)
        {
            // context.HttpContext.Response.StatusCode = 401;
            // context.HttpContext.Response.WriteAsJsonAsync(new
            // {
            //     message=businessException.Message
            // });
        }
    }
}